struct Solution {}

fn main() {}

impl Solution {
    pub fn find_closest_number(nums: Vec<i32>) -> i32 {
        let mut distance = i32::MAX;
        let mut ret = nums[0];
        for num in nums.iter() {
            if num.abs() - 0 < distance {
                distance = num.abs() - 0;
                ret = *num;
            }
            if num.abs() - 0 == distance {
                if ret < *num {
                    ret = *num;
                }
            }
        }
        ret
    }
}